home *** CD-ROM | disk | FTP | other *** search
- WordUp Graphics Toolkit Version 3.5
- Quick Reference Guide
-
-
- Initialization:
- ~~~~~~~~~~~~~~~
- void vga256(void)
- Initialize the graphics mode 320x200x256
-
-
- Graphics Primitives
- ~~~~~~~~~~~~~~~~~~~
- void wbar(int x1,int y1,int x2,int y2)
- Draws a filled rectangle
-
- void wbutt(int x1,int y1,int x2,int y2)
- Draws a 3-Dimensional button
-
-
- void wcircle(int x,int y,int radius)
- Draws a hollow circle
-
- void wclip(int x1,int y1,int x2,int y2)
- Sets clipping variables
-
- void wcls(int color)
- Clears the screen with a color
-
- void wfastputpixel(int x,int y)
- Fastest pixel write to the screen (no clipping)
-
- void wfill_circle(int x,int y,int radius)
- Draws a filled circle
-
- void wfline(int x,int y,int x2,int y2)
- Fast line draw
-
- void wgetpixel(int x,int y);
- Reads a pixel from the screen
-
- void wline(int x1,int y1,int x2,int y2)
- Draws a line from pt x1,y1 to x2,y2
-
- void wputpixel(int x,int y)
- Writes a pixel to the screen
-
- void wrectangle(int x1,int y1,int x2,int y2)
- Draws a rectangle
-
- void wregionfill(int x,int y)
- Fills using the current colour
-
- void wretrace(void)
- Waits for a vertical retrace
-
- void wstyleline(int x1,int y1,int x2,int y2,unsigned int style);
- Draws a styled line.
-
-
-
- Colours and Palettes
- ~~~~~~~~~~~~~~~~~~~~
- void wcolrotate(int start,int finish,int direction,color palette[255])
- Rotates colours
-
- void wfade_in(int start,int finish,int speed, color palette[255]);
- Fades from black to colours in palette
-
- void wfade_out(int start,int finish,int speed,color palette[255]);
- Fades from colours in palette to black
-
- void wloadpalette(char *filename,color *palette)
- Loads a palette file from disk
-
- void wreadpalette(int start,int finish, color *palette)
- Reads the current palette in array
-
- void wremap(color *pal1,block remapblock,color *pal2)
- Remaps one palette onto another.
-
- void wsavepalette(char *filename, color *palette);
- Save a palette file to disk
-
- void wsetcolor(int color)
- Sets current drawing colour
-
- void wsetpalette(int start,int finish, color *palette)
- Sets part or all of the palette
-
-
- void wsetrgb(int color,int red,int green, int blue, color *palette)
- Sets an individual colour, doesn't change until wsetpalette
-
-
-
-
-
- Image Transfer
- ~~~~~~~~~~~~~~
- void wflipblock(block blockname, int direction);
- Flips a previously allocated block
-
- void wfreeblock(block blockname)
- Frees memory from block
-
- int wgetblockheight(block blockname);
- Returns the height of the block
-
- int wgetblockwidth(block blockname);
- Returns the width of the block
-
- block wloadblock(char *filename)
- Loads block from disk, allocates memory automatically
-
- block wloadcel(char *filename, color *palette);
- Loads a CEL file into a block, allocs memory
-
- block wloadpak(char *filename)
- Loads a PAK files from disk, allocates block
-
- block wloadpcx256(char *filename, color *palette);
- Loads a PCX file to the screen
-
- block wnewblock(int x1,int y1,int x2,int y2)
- Allocates and grabs an image
-
- void wputblock(int x,int y, block blockname, int mode)
- Pastes a block on the screen, in copy or xray modes
-
- int wsaveblock(char *filename, block blockname)
- Saves a block to disk
-
- void wsavecel(char *filename,block saveblock,color palette[256]);
- Saves a block in CEL format
-
- int wsavepak(char *filename,block blockname)
- Saves a block in PAK format
-
- void wsavepcx256(char *filename,block blockname,color *pcxpal)
- Saves a block in PCX format
-
-
-
-
- Mouse Control
- ~~~~~~~~~~~~~
- int minit(void);
- Initializes mouse, returns number of buttons
-
- void moff(void)
- Turns the mouse cursor off
-
- void mon(void)
- Turns the mouse cursor on
-
- void mouseshape(int rowhot,int colhot, void far *bitmap)
- Change the hotspot and shape of the mouse cursor
-
- void mread(void)
- Reads mouse coordinates and button state into mx,my,but
-
- void msetbounds(int minx,int miny,int maxx,int maxy)
- Sets the range the mouse cursor moves in
-
- void msetspeed(int x_speed,int y_speed)
- Adjusts the vertical and horizontal mouse speed
-
- void msetthreshhold(int speed)
- Sets which speed doubles the mouse movement
-
- void noclick(void)
- Loops until all mouse buttons are released
-
-
- Screen Manipulation
- ~~~~~~~~~~~~~~~~~~~
- void wcopyscreen(int x1,int y1,int x2,int y2,block source,int dx,int dy,
- block dest)
- Copy an area of a page to another location on same or
- different page. Pass NULL as source or dest to copy to or
- from visual page
-
- void wnormscreen(void)
- Sets active drawing page to visual page
-
- void wsetscreen(block screenname)
- Sets active drawing page to a full screen block
-
-
- Text and Fonts
- ~~~~~~~~~~~~~~
- void wflashcursor(void)
- Flashes the similated text cursor once
-
- void wfreefont(wgtfont yourfont)
- Frees memory from a previously loaded font
-
- int wgettextheight(char *printme,wgtfont prfont)
- Returns the height of the tallest letter in the string
-
- int wgettextwidth(char *printme,wgtfont prfont)
- Returns the width of the entire string
-
- void wgtprintf(int xloc,int yloc,wgtfont wgtprfon,char *fmt, ... )
- Allows printf commands in graphics mode
-
- wgtfont wloadfont(char *fontfile)
- Loads and allocates memory for a custom font
-
- void wouttextxy(int x,int y, char *string,wgtfont font)
- Displays a string at screen coordinates
-
- void wsetcursor(int y,int y2)
- Sets the height of the text cursor
-
- int wstring(int x,int y, char *instring, char *legal, int num)
- Inputs a text string using the normal font
-
- void wtextbackground(unsigned char color)
- Sets the background text colour
-
- void wtextcolor(unsigned char color)
- Sets the foreground text colour
-
- void wtextgrid(int state)
- Turns the text grid on or off
-
- void wtexttransparent(int mode)
- Turns text foreground or background on or off
-
-
- Special Effects
- ~~~~~~~~~~~~~~~
- void wfade(block sourcescreen, int *pattern, int speed)
- Fades a screen in, using a custom made pattern
-
- void wmovescreen(int x1,int y1, int x2,iny y2,int direction,int speed)
- Moves a screen area in a direction
-
- void wpan(int offset)
- Changes the offset of the visual screen
-
- void wresize(int x1,int y1,int x2,int y2, block blockname);
- Changes the size of a block on the screen
-
- void wskew(int x,int y,block skewblock,int degrees)
- Horizontally skews a block on the screen
-
- void wsline(int x1,int y1,int x2,int y2,int *ptarray);
- Stores points on a line into an array. (used for wwarp)
-
- void wvertres(int x1,int y1,int y2, block blockname);
- Vertically resizes a block
-
- void wwarp(int x1,int x2,int *top,int *bot, block blockname);
- Warps a block by using different resize rates
-
- void wwipe(int x1,int y1, int x2,iny y2,block screen)
- Draws a line using colours from a hidden page
-
-
-
- FLI Routines
- ~~~~~~~~~~~~
- void closefli(void);
- Close FLI file
-
- void copyfli(void);
- Copy fliscreen to visual screen
-
- void openfli(char *filename);
- Opens and initializes FLI file
-
- void nextframe(void);
- Reads next frame of FLI file onto fliscreen
-
-
-
-
- Sprites
- ~~~~~~~
- void wfreesprites(block sprites[1001]);
- Frees sprite array
-
- int wloadsprites(color *palette,char *filename,block sprites[1001]);
- Loads a sprite file, created with WGT Sprite Creator
-
-
-
- Sprite Library
- ~~~~~~~~~~~~~~
- void animate(int spritenum,char *animation sequence);
- Sets animation for a sprite
-
- void animoff(int spritenum);
- Turns off animation for a sprite
-
- void animon(int spritenum);
- Turns on animation for a sprite
-
- void initspr(void);
- Initializes sprite movement and animation library
-
- void movex(int spritenum,char *movement sequence);
- Sets horizontal movement for a sprite
-
- void movey(int spritenum,char *movement sequence);
- Sets vertical movement for a sprite
-
- void movexoff(int spritenum);
- Turns off horizontal movement for a sprite
-
- void movexon(int spritenum);
- Turns on horizontal movement for a sprite
-
- void moveyoff(int spritenum);
- Turns off vertical movement for a sprite
-
- void moveyon(int spritenum);
- Turns on vertical movement for a sprite
-
- int overlap(int spritenum_1,int spritenum_2);
- Checks for a collision between two sprites
-
- void spriteon(int spritenum,int x coord,int y coord,int number);
- Turns sprite on
-
- void spriteoff(int spritenum);
- Turns sprite off
-
-
-
- Drop down menus
- ~~~~~~~~~~~~~~~
- int checkmenu(void);
- Loops until user clicks mouse button on menu
-
- void initdropdowns(void);
- Initializes drop down menus
-
- void removemenubar(void);
- Removes top menu bar
-
- void showmenubar(void);
- Shows top menu bar
-
-
-
- Graphical File Selector
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- char *wfileselector(char *oper,char *search)
- Calls the graphical file selector
- Oper is a text string to display on top of selector
- Search is the file mask (*.spr, *.doc etc)
-
-
- 4-way Scrolling
- ~~~~~~~~~~~~~~~
- void installkbd(void);
- Install the custom keyboard interrupt
-
- void soverlap(int obj1,int obj2);
- Detect collisions of scrolling objects
-
- void uninstallkbd(void);
- Remove the custom keyboard interrupt
-
- void wcopyscroll(int x,int y);
- Copies scrolled screen to visual screen
-
- void wendscroll(void);
- Shut down 4-way scrolling system
-
- void wfreemap(wgtmap mymap);
- Frees memory from a previously loaded map
-
- int wgetworldblock(int posx,int posy,wgtmap mymap);
- Read a tile from a position on the map
-
- void winitscroll(int window_x_size,int window_y_size);
- Initializes scrolling window
-
- wgtmap wloadmap(char *filename);
- Loads and allocates a map made from WGT map maker
-
- void wputworldblock(int posx,int posy ,int blocknum,wgtmap mymap);
- Puts a tile onto the map
- (Use World Coords)
-
- void wsavemap(char *filename,wgtmap savemap);
- Saves a map file, for saving games
-
- void wscrollwindow(int x_speed,int y_speed, wgtmap mymap);
- Scroll the window in any direction
-
- void wshowobjects(void);
- Show objects on top of scrolling background
-
- void wshowwindow(int posx,int posy ,wgtmap mymap);
- Look at world at coordinates, used for warping player
- to new spot on map.
-
-
-
-
- WGT Library
- ~~~~~~~~~~~
- char *getlib(void)
- Returns the library filename
-
- void *lib2buf(char *filename)
- Loads a file from the WGT library file, returns a pointer
-
- void setlib(char *libname)
- Sets library filename
-
- void setpassword(char *newpassword)
- Sets the library file password
-
-
- Timing
- ~~~~~~
- int wtimer(struct time t,struct time t2)
- Return difference between two times in hundredths of seconds
-
- Joystick
- ~~~~~~~~
- int wcheckjoystick(void)
- Checks to see which joysticks are available
-
- void winitjoystick(joystick *joy, int joynum)
- Initializes joystick
-
- void wcalibratejoystick(joystick *joy)
- Calibrates joystick, must call twice
-
- int wreadjoystick(joystick *joy)
- Reads joystick values into joystick structure
-
-
- SoundBlaster VOC
- ~~~~~~~~~~~~~~~~
- int winitsb(void)
- Initialize digital sound
-
- int wsbversion(void)
- Returns driver version
-
- void waddr(int base)
- Set I/O address
-
- void wirq(int irq)
- Set IRQ number
-
- void wdeinitsb(void)
- Shut down digitial sound
-
- void wsetspeaker(int onoff)
- Turn speaker on (1) or off (0)
-
- void wplayvoc(wgtvoice buffer)
- Plays a VOC file
-
- void wsample(wgtvoice buffer, long length)
- Records into buffer
-
- void wstopvoc(void)
- Stops VOC from playing
-
- void wpausevoc(void)
- Pauses VOC output
-
- void wresumevoc(void)
- Resumes VOC output
-
- void wfreevoc(wgtvoice vocname)
- Frees memory from voice file
-
- wgtvoice wnewvoice(long size)
- Allocs memory for sampling
-
- wgtvoice wloadvoc(char *name)
- Loads a VOC file
-
-
- SoundBlaster CMF
- ~~~~~~~~~~~~~~~~
- void wfmsetstatus(unsigned ofs,unsigned seg);
- Set the status variable, automatically set to fmstat
-
- unsigned wfmversion(void);
- Return FM driver version
-
- void wfmreset(void);
- Resets the CMF driver
-
- void wfmstopmusic(void);
- Stops CMF music
-
- void wfmsongspeed(unsigned ss);
- Sets tempo of CMF
-
- int wfindfm(void);
- Search for the SBFMDRV in memory, and init CMF
-
- void wplaycmf(wgtsong song);
- Play CMF file
-
- wgtsong wloadcmf(char *loadfile);
- Load CMF file
-